//
//  YMJTableViewCell.m
//  10-易车作业
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 YMJ. All rights reserved.
//

#import "YMJTableViewCell.h"

@interface YMJTableViewCell ()
@property (nonatomic, strong) UILabel *labelYMJ;
@property (nonatomic, strong) UIImageView *imageViewYMJ;
@end
@implementation YMJTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _labelYMJ = [[UILabel alloc] init];
        [self.contentView addSubview:_labelYMJ];
        _labelYMJ.backgroundColor = [UIColor clearColor];
        _imageViewYMJ = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageViewYMJ];
        _imageViewYMJ.backgroundColor = [UIColor yellowColor];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    _imageViewYMJ.frame = CGRectMake(15, 24, 127, 79);
    _labelYMJ.frame = CGRectMake(150, 46, 264, 33);
}
- (void)setList:(List *)list {
    _list = list;
    _labelYMJ.text = _list.title;
    NSURL *url = [NSURL URLWithString:_list.picCover];
    NSData *data = [NSData dataWithContentsOfURL:url];
//    [_imageViewYMJ sd_setImageWithURL:url];
    _imageViewYMJ.image = [UIImage imageWithData:data];
//    NSLog(@"网址%@",url);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
